package org.vison.wonfu.framework.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;
import org.vison.wonfu.framework.commons.utils.AppUtils;


public class ApolloBootPostProcessor implements EnvironmentPostProcessor {


    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
        System.out.println("ApolloBootPostProcessor");
        String appId = AppUtils.getAppId();
        if (appId != null) {
            environment.getSystemProperties().put("app.id", appId);
        }
        String meta = environment.getProperty("wonfu.apollo.meta");
        if (meta != null) {
            environment.getSystemProperties().put("apollo.meta",meta);
        }
    }
}
